import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

import Layout from '../views/layout/Layout'


export const constantRouterMap = [{
    path: '/404',
    component: () =>
      import('@/views/404'),
    hidden: true
  },
  {
    path: '/login',
    component: () =>
      import('@/views/login/index'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [{
        name: 'home',
        meta: {
          title: '首 页',
          icon: 'home (1)'
        },
        path: 'home',
        component: () =>
          import('@/views/home/index')
      }
    ]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/company',
    children: [{
      path: 'company',
      name: 'company',
      meta: {
        icon: 'wendang',
        title: '公司信息'
      },
      component: () =>
        import('@/views/company/index.vue')
    }]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/product',
    children: [{
      path: 'product',
      name: 'product',
      meta: {
        icon: 'chanpin',
        title: '产品管理'
      },
      component: () =>
        import('@/views/product/index.vue')
    }]
  }
  ,
  {
    path: '/',
    component: Layout,
    redirect: '/productdetail',
    children: [{
      path: 'productdetail',
      name: 'productdetail',
      // meta: {
      //   icon: 'STATISTICS',
      //   title: '产品详情'
      // },
      component: () =>
        import('@/views/product/detail.vue')
    }]
  }
  ,
  {
    path: '/',
    component: Layout,
    redirect: '/bussiens',
    children: [{
      path: 'bussiens',
      name: 'bussiens',
      meta: {
        icon: 'shangji',
        title: '商机管理'
      },
      component: () =>
        import('@/views/bussiens/index.vue')
    }]
  }
  ,
  {
    path: '/',
    component: Layout,
    redirect: '/bussiensdetail',
    children: [{
      path: 'bussiensdetail',
      name: 'bussiensdetail',
      // meta: {
      //   icon: 'STATISTICS',
      //   title: '商机详情'
      // },
      component: () =>
        import('@/views/bussiens/detail.vue')
    }]
  }
  ,
  {
    path: '/',
    meta: {
      icon: 'home',
      title: '分类管理'
    },
    hidden: true,
    component: Layout,
    redirect: '/categoryList',
    children: [
      // {
      //   path: 'categoryEdit',
      //   name: 'categoryEdit',
      //   meta: {
      //     icon: 'home',
      //     title: '添加分类'
      //   },
      //   component: () =>
      //     import('@/views/category/system/categoryEdit.vue')
      // },
      // {
      //   path: 'categoryList',
      //   name: 'categoryList',
      //   meta: {
      //     icon: 'home',
      //     title: '分类列表'
      //   },
      //   component: () =>
      //     import('@/views/category/system/categoryList.vue')
      // },
      // {
      //   path: 'addCategory',
      //   name: 'addCategory',
      //   hidden: true,
      //   meta: {
      //     icon: 'home',
      //     title: '添加分类'
      //   },
      //   component: () =>
      //     import('@/views/category/user/categoryEdit.vue')
      // },
      // {
      //   path: 'category_list',
      //   name: 'category_list',
      //   hidden: true,
      //   meta: {
      //     icon: 'home',
      //     title: '分类列表'
      //   },
      //   component: () =>
      //     import('@/views/category/user/categoryList.vue')
      // },
      {
        path:'updatepassWord',
        name: 'updatepassWord',
        meta: {
          icon: 'STATISTICS',
          title: '修改密码'
        },
        component: () =>
          import('@/views/settings/user/updatepassWord.vue')
      }
    ]
  }
  ,
  // {
  //   path: '/',
  //   component: Layout,
  //   redirect: '/articleList',
  //   hidden: true,
  //   meta: {
  //     title: '信息管理',
  //     icon: 'settings'
  //   },
  //   children: [{
  //     name: 'articleList',
  //     path: '/articleList',
  //     component: () =>
  //       import('@/views/article/articleList'),
  //     meta: {
  //       title: '信息列表',
  //       icon: 'settings'
  //     },
  //   }, {
  //     name: 'addArticle',
  //     path: '/addArticle',
  //     component: () =>
  //       import('@/views/article/articleEdit'),
  //     meta: {
  //       title: '添加文章',
  //       icon: 'settings'
  //     }
  //   }
  // ]
  // },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

export default new Router({
  // mode: 'history', //hash
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRouterMap

})
